"""author: songzhiqiang
   data: 2021/11/21
   project: zuoye
"""
import chardet

txt = open('Walden.txt', 'rb').readlines()
# print(chardet.detect(txt))
#print(txt)
counts = []
for num in txt:
    if num == ',' or num == '?' or num == '.' or num == ';':  # 排除数字文本中可能出现的特殊字符
        continue
    else:
        counts.append(num)
        print(counts)
